

class locker:
	def __init__(self):
		print('locker 类型初始化');

	def start(name):
		print('locker.start() name:',name)

	def end(name):
		print('locker.end name:',name)

		
def loggin(cls):
	def warpper(func):
		def inner_warpper(*args,**kwargs):
			name = kwargs['name']
			'''
			注意这里  kwargs['name']  如果调用的时候没有传递 name 这个参数，那么这个
			方法就会抛异常
			'''
			cls.start(name);
			func(*args,**kwargs)
			cls.end(name);
		return inner_warpper;
	return warpper;


@loggin(locker)
def myfunc(name):
	print('myfunc  name:',name)


myfunc(name='qiaoansheng')